/**
 * scale-table.css
 * Style du tableau de gamme (affichage des 7 degrés)
 * ✅ Responsive optimisé pour mobile
 */

/* ============================================
   🎼 TABLEAU DE GAMME
   ============================================ */

.scale-table-container {
    margin-top: clamp(1rem, 3vw, 2rem);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    box-sizing: border-box;
}

.scale-grid-container {
    display: grid;
    grid-template-columns: repeat(7, minmax(clamp(60px, 12vw, 100px), 1fr));
    gap: 0;
    max-width: min(900px, 100%);
    margin: 0 auto;
    padding: 0;
    background: transparent;
    border: clamp(1.5px, 0.3vw, 3px) solid #808000;
    border-radius: clamp(8px, 1.5vw, 12px);
    overflow: hidden;
    box-sizing: border-box;
}

/* ============================================
   🎯 COLONNE DE GAMME
   ============================================ */

.scale-column-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: clamp(60px, 12vw, 100px);
    border-right: 1.5px solid #808000;
}

.scale-column-wrapper:last-child {
    border-right: none;
}

/* ============================================
   🎨 CELLULES DE GAMME
   ============================================ */

.scale-degree-cell,
.scale-interval-cell,
.scale-note-cell,
.scale-quality-cell {
    padding: clamp(0.4rem, 2vw, 0.75rem) clamp(0.25rem, 1.5vw, 0.5rem);
    text-align: center;
    border-bottom: 1.5px solid #808000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* Hauteurs fixes pour uniformiser */
.scale-degree-cell {
    min-height: clamp(2.25rem, 5vw, 3rem);
}

.scale-interval-cell {
    min-height: clamp(2.75rem, 6vw, 3.5rem);
}

.scale-note-cell {
    min-height: clamp(2.25rem, 5vw, 3rem);
}

.scale-quality-cell {
    min-height: clamp(2.25rem, 5vw, 3rem);
    border-bottom: none;
}

/* Cellule du degré */
.scale-degree-cell {
    font-weight: 700;
    font-size: clamp(0.8rem, 2.5vw, 1.1rem);
    color: #333;
    background: #e0d5a0;
}

/* Cellule de l'intervalle */
.scale-interval-cell {
    color: #666;
    font-size: clamp(0.55rem, 1.5vw, 0.8rem);
    font-weight: 500;
    background: #f5f5f0;
    line-height: 1.2;
}

/* Cellule de la note */
.scale-note-cell {
    font-weight: 600;
    font-size: clamp(0.75rem, 2.5vw, 1.05rem);
    color: #333;
    background: #FFFAEB;
}

/* Cellule de la qualité d'accord */
.scale-quality-cell {
    font-weight: 500;
    font-size: clamp(0.65rem, 2vw, 0.9rem);
    color: #808000;
    background: white;
}

/* ============================================
   📱 RESPONSIVE - MOBILE (≤768px)
   ============================================ */

@media (max-width: 768px) {
    .scale-table-container {
        margin-top: 1rem;
    }
    
    .scale-grid-container {
        grid-template-columns: repeat(7, minmax(60px, 1fr));
        border-width: 2px;
        border-radius: 8px;
        max-width: 100%;
    }
    
    .scale-column-wrapper {
        min-width: 60px;
    }
    
    .scale-degree-cell,
    .scale-interval-cell,
    .scale-note-cell,
    .scale-quality-cell {
        padding: 0.4rem 0.2rem;
    }
    
    .scale-degree-cell {
        font-size: 0.85rem;
        min-height: 2.25rem;
    }
    
    .scale-interval-cell {
        font-size: 0.6rem;
        min-height: 2.75rem;
    }
    
    .scale-note-cell {
        font-size: 0.8rem;
        min-height: 2.25rem;
    }
    
    .scale-quality-cell {
        font-size: 0.7rem;
        min-height: 2.25rem;
    }
}

/* ============================================
   📱 RESPONSIVE - TRÈS PETIT MOBILE (≤480px)
   ============================================ */

@media (max-width: 480px) {
    .scale-table-container {
        margin-top: 0.75rem;
    }
    
    .scale-grid-container {
        grid-template-columns: repeat(7, minmax(50px, 1fr));
        border-width: 1.5px;
        border-radius: 6px;
    }
    
    .scale-column-wrapper {
        min-width: 50px;
    }
    
    .scale-degree-cell,
    .scale-interval-cell,
    .scale-note-cell,
    .scale-quality-cell {
        padding: 0.35rem 0.15rem;
    }
    
    .scale-degree-cell {
        font-size: 0.75rem;
        min-height: 2rem;
    }
    
    .scale-interval-cell {
        font-size: 0.5rem;
        min-height: 2.5rem;
    }
    
    .scale-note-cell {
        font-size: 0.7rem;
        min-height: 2rem;
    }
    
    .scale-quality-cell {
        font-size: 0.6rem;
        min-height: 2rem;
    }
}

/* ============================================
   🖥️ RESPONSIVE - TABLETTE (768px - 1024px)
   ============================================ */

@media (min-width: 769px) and (max-width: 1024px) {
    .scale-grid-container {
        max-width: 90vw;
    }
    
    .scale-column-wrapper {
        min-width: 90px;
    }
}

/* ============================================
   PRÉFÉRENCE MOUVEMENT RÉDUIT
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .scale-column-wrapper {
        transition: none;
    }
}

/* ============================================
   PRINT
   ============================================ */

@media print {
    .scale-table-container {
        page-break-inside: avoid;
    }
}
